package FWK.components;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;


public class FwkDesktopPane extends JDesktopPane implements FwkComponent{ 

    /**
	 * 
	 */
	private static final long serialVersionUID = -2395166893973523311L;
	private Image image; 
     
    public FwkDesktopPane(String pathImage) { 
        super(); 
        
        image = new ImageIcon(pathImage).getImage(); 
        setBackground(new Color(69, 64, 92)); 
    } 

    @Override 
    protected void paintComponent(Graphics g) { 
        super.paintComponent(g); 
        int h = (int)image.getHeight(null)/2; 
        int w = (int)(image.getWidth(null)/2); 
        g.drawImage(image, (int)getWidth()/2 - w, (int)getHeight()/2 - h, null); 
    }

	@Override
	public void activate() {
		this.setEnabled(true);
		
	}

	@Override
	public void standBy() {
		this.setEnabled(true);
	} 
}  